//    Copyright (C) Kherty.  All rights reserved.
using System.Windows;
using OpenLS.UI.Interop;

namespace OpenLS.UI
{
    public abstract class FileDialog
    {
                public bool? ShowDialog(){return ShowDialog(null);}
                public abstract bool? ShowDialog(Window window);

        private string _defaultExt;

        public string DefaultExt
        {
            get { return _defaultExt; }
            set { _defaultExt = value; }
        }
	
        private string _filter;

        public string Filter
        {
            get { return _filter; }
            set { _filter = value; }
        }
	
        private bool _addExtension;

        public bool AddExtension
        {
            get { return _addExtension; }
            set { _addExtension = value; }
        }
	
        private string[] _fileNames;

        public string[] FileNames
        {
            get { return _fileNames; }
            internal set { _fileNames = value; }
        }

        private string _fileName;

        public string FileName
        {
            get { return _fileName; }
            set { _fileName = value; }
        }
        internal static IShellItem GetShellItemAt(IShellItemArray array, int i)
        {
            IShellItem result;
            uint index = (uint)i;
            array.GetItemAt(index, out result);
            return result;
        }
        internal static string GetFileNameFromShellItem(IShellItem item)
        {
            string filename;
            item.GetDisplayName(NativeMethods.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out filename);
            return filename;
        }




    }
}
